// JavaScript Document
function getNav_style_nun(){
	var url = window.location.href;
	var params = url.split("?")[1];
	var nav_style = "0";
	if(params){
		var params_init = params.split('&');
		for(var i =0;i<params_init.length;i++){
			var paramMap = params_init[i].split("=");
			if(paramMap[0] == "nav_style"){
				nav_style = paramMap[1];
				break;
			}
		}
	}
	return nav_style;
}

//搜索
function listsearch(q){
	q = encodeURI(encodeURI(q));
	window.open("/goods_lists.html?q="+q);
}

//判断搜索框是否为空
function zongsearch_goods(){ 

	var q = trimTxt(document.getElementById("search_key").value); 
	 q = encodeURI(encodeURI(q));

	if(q != ""){
	window.open("/goods_lists.html?q="+q); 
	} else {
	alert("请输入关键字以查找您需要的信息！");
	}	
}

//去空格
function trimTxt(txt){
   return txt.replace(/(^\s*)|(\s*$)/g, "");
}

//获得url
function gotoUrl(url,num){
	if(url.indexOf('?') > -1){
		window.location.href = url + "&nav_style=" + num;
	}else{
		window.location.href = url + "?nav_style=" + num;
	}
}

//回车事件
function SubmitKeyClick(){
	if(event.keyCode == 13) 
	{ 
		event.keyCode=9;
		event.returnValue = false; 
		document.all["btnSearch"].click(); 
	}
}


function quickQueryCust(event){   
	var evt = event ? event :(window.event ? window.event : null);
	if(evt.keyCode==13){
		//执行的方法
		zongsearch_goods();
	} 
}


